package docmodel;

import java.util.LinkedList;

/**
 * Mantiene la lista di Campi di un documento, evita di inserire duplicati
 * 
 * @author andrea
 *
 */
public class XDP_Liste {
	
	/** */
	public LinkedList<FloatingField> listaFloatingFields;
	
	/**
	 * 
	 */
	public XDP_Liste() 
	{	
		listaFloatingFields = new LinkedList<FloatingField>();
	}

	/**
	 * 
	 * @param field
	 */
	public void aggiungi_field(FloatingField field ) 
	{	
		for(FloatingField ff : listaFloatingFields) 
		{	
			if(ff.getId().equals(field.getId()))    //evita duplicati
				return; 
		}
		listaFloatingFields.add(field);
		
		//P
		System.out.println("field aggiunto");
	}

	/**
	 * 
	 */
	public void stampa_lista()
	{
		//P
		System.out.println("******************************");	
		for(FloatingField ff : listaFloatingFields) {	
			System.out.println(ff.getId());	
		}
		//P
		System.out.println("******************************\n\n");
	}
	
}